package com.authine.cloudpivot.web.api.service.impl;

import com.authine.cloudpivot.web.api.dao.ErpMapper;
import com.authine.cloudpivot.web.api.service.ErpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Slf4j
@Service
public class ErpServiceImpl implements ErpService {

    @Autowired
    private ErpMapper erpMapper;

    @Override
    public List<Map<String, String>> getSubjectList() {
        return erpMapper.getSubjectList();
    }

    @Override
    public void updateSalaryPay(Map<String, Map<String, String>> maps) {
        for (Map<String, String> value : maps.values()) {
            erpMapper.updateSalary(value);
            erpMapper.updatePay(value);
        }
        erpMapper.updatePayIsVerify();
        erpMapper.updateErpSalay();
    }
}